package org.admanager.mapping.plugin.diagram.edit.policies;

import org.admanager.mapping.plugin.diagram.edit.commands.PComponent2CreateCommand;
import org.admanager.mapping.plugin.diagram.edit.commands.PReferenceCreateCommand;
import org.admanager.mapping.plugin.diagram.edit.commands.PServiceCreateCommand;
import org.admanager.mapping.plugin.diagram.providers.SOADManagementMetamodelElementTypes;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;

/**
 * @generated
 */
public class PCompositePCompositeCompartmentItemSemanticEditPolicy extends
		SOADManagementMetamodelBaseItemSemanticEditPolicy {

	/**
	 * @generated
	 */
	public PCompositePCompositeCompartmentItemSemanticEditPolicy() {
		super(SOADManagementMetamodelElementTypes.PComposite_3020);
	}

	/**
	 * @generated
	 */
	protected Command getCreateCommand(CreateElementRequest req) {
		if (SOADManagementMetamodelElementTypes.PComponent_3021 == req
				.getElementType()) {
			return getGEFWrapper(new PComponent2CreateCommand(req));
		}
		if (SOADManagementMetamodelElementTypes.PService_3024 == req
				.getElementType()) {
			return getGEFWrapper(new PServiceCreateCommand(req));
		}
		if (SOADManagementMetamodelElementTypes.PReference_3025 == req
				.getElementType()) {
			return getGEFWrapper(new PReferenceCreateCommand(req));
		}
		return super.getCreateCommand(req);
	}

}
